package cloudy.trident.drpc;

import org.apache.storm.Config;
import org.apache.storm.thrift.TException;
import org.apache.storm.utils.DRPCClient;

/**
 * @Name cloudy.trident.drpc.TridentDRPCClient
 * @Description
 * @Author Elwyn
 * @Version 2017/9/30
 * @Copyright 上海云辰信息科技有限公司
 **/
public class TridentDRPCClient {
	public static void main(String[] args) {
		try {
			DRPCClient drpcClient = new DRPCClient(new Config(), "192.168.241.18", 3772);

			while (true) {
				String getOrderAmt = drpcClient.execute("getOrderAmt", "2017-09-30:1 2017-09-30:2 2017-09-30:3 2017-09-30:4 2017-09-30:5 2017-09-30:6 " +
						"2017-09-30:7 2017-09-30:8");
				System.err.println("amt" + getOrderAmt);
				String getOrderNum = drpcClient.execute("getOrderNum", "2017-09-30:1 2017-09-30:2 2017-09-30:3 2017-09-30:4 2017-09-30:5 2017-09-30:6 " +
						"2017-09-30:7 2017-09-30:8");
				System.err.println("num" + getOrderNum);
				org.apache.storm.utils.Utils.sleep(1000);
			}
		} catch (TException e) {
			e.printStackTrace();
		}


	}
}
